package com.java83.service.impl;

import com.java83.dao.LeavingDao;
import com.java83.dao.LeavingResonDao;
import com.java83.dto.impl.OneDto;
import com.java83.entity.Leaving;
import com.java83.entity.LeavingReson;
import com.java83.service.LeavingResonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 张健聪
 * @program java-83-group-5-hou
 * @description
 * @date 2021-12-14 14:34
 **/
@Service
public class LeavingResonServiceImpl implements LeavingResonService {
    @Autowired(required = false)
    LeavingResonDao leavingResonDao;

    @Override
    public int add(LeavingReson leavingReson) {
       return leavingResonDao.insert(leavingReson);
    }

    @Override
    public List<LeavingReson> findAll(LeavingReson leavingReson) {
        return leavingResonDao.queryAllByLimit(leavingReson);
    }

    @Override
    public int delete(int id) {
        return leavingResonDao.deleteById(id);
    }

    @Override
    public int update(LeavingReson leavingReson) {
        return leavingResonDao.update(leavingReson);
    }
}
